<?php

class HModulesInstances {
	function getInstanceById($id) {
		$a = HSql::doQuery("SELECT id, module_id, view_file, friendly_name FROM portal_modules_instances WHERE id = '$id'");
		if (count($a) == 0) return null;
		else return $a;
	}
	
	function getViewFileById($id) {
		$a = HSql::fetch2Array(HSql::doQuery("SELECT id, view_file, friendly_name FROM portal_modules_instances WHERE id = '$id'"));		
		if (count($a) == 0) return 'index.php';
		else return $a[0]['view_file'];
	}
}